package cn.com.cfae.iras.doc.analyze.parse.model.table;

import cn.com.cfae.iras.doc.analyze.keys.ExtractMethod;
import cn.com.cfae.iras.doc.analyze.parse.extractor.*;
import cn.com.cfae.iras.doc.analyze.parse.model.*;
import cn.com.cfae.iras.doc.analyze.parse.model.iaad.*;

import java.util.*;

public class BDMTable extends BaseTable {
    public final static String BDM0 = "BDM-0";
    public final static String BDM1 = "BDM-1";
    public final static String BDM2 = "BDM-2";
    public final static String BDM3 = "BDM-3";
    public final static String BDM4 = "BDM-4";
    public final static String BDM5 = "BDM-5";
    public final static String BDM6 = "BDM-6";
    public final static String BDM7 = "BDM-7";
    public final static String BDM8 = "BDM-8";
    public final static String BDM9 = "BDM-9";
    public final static String BDM10 = "BDM-10";
    public final static String BDM11 = "BDM-11";
    public final static String BDM12 = "BDM-12";
    public final static String BDM13 = "BDM-13";


    private Map<String, ExtractBizModel> bdm0 = null;
    private Map<String, ExtractBizModel> bdm1 = null;
    private Map<String, ExtractBizModel> bdm2 = null;
    private Map<String, ExtractBizModel> bdm3 = null;
    private Map<String, ExtractBizModel> bdm4 = null;
    private Map<String, ExtractBizModel> bdm5 = null;
    private Map<String, ExtractBizModel> bdm6 = null;
    private Map<String, ExtractBizModel> bdm7 = null;
    private Map<String, ExtractBizModel> bdm8 = null;
    private Map<String, ExtractBizModel> bdm9 = null;
    private Map<String, ExtractBizModel> bdm10 = null;
    private Map<String, ExtractBizModel> bdm11 = null;
    private Map<String, ExtractBizModel> bdm12 = null;
    private Map<String, ExtractBizModel> bdm13 = null;

    private static DMTable instance = new DMTable();

    public BDMTable() {
        super(TableType.BDM);
    }


    public static DMTable getInstance() {
        return instance;
    }


    public Map<String, ExtractBizModel> getExtractBizModelMap(String tableId) {
        switch (tableId) {
            case BDM0:
                return createBDM0ExtractBizModel();
            case BDM1:
                return createBDM1ExtractBizModel();
            case BDM2:
                return createBDM2ExtractBizModel();
            case BDM3:
                return createBDM3ExtractBizModel();
            case BDM4:
                return createBDM4ExtractBizModel();
            case BDM5:
                return createBDM5ExtractBizModel();
            case BDM6:
                return createBDM6ExtractBizModel();
            case BDM7:
                return createBDM7ExtractBizModel();
            case BDM8:
                return createBDM8ExtractBizModel();
            case BDM9:
                return createBDM9ExtractBizModel();
            case BDM10:
                return createBDM10ExtractBizModel();
            case BDM11:
                return createBDM11ExtractBizModel();
            case BDM12:
                return createBDM12ExtractBizModel();
            case BDM13:
                return createBDM13ExtractBizModel();
            default:
                break;
        }
        return null;
    }

    public ExtractBizModel getExtractBizModel(String tableId, String modelName) {
        return getExtractBizModelMap(tableId).get(modelName);
    }


    /**
     * M0（封皮、目录、重要提示）
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM0ExtractBizModel() {
        bdm0=new HashMap<>();
        {
            //M0-封皮-发行人
            ExtractBizModel fxr = new ExtractBizModel();
            fxr.setModelName(FXRModel.MODEL_NAME);
            fxr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxr.setExtractItemList(FXRModel.createExtractItemList());
            bdm0.put(fxr.getModelName(), fxr);
        }

        {
            //M0-封皮-评级机构
            ExtractBizModel xypjjg = new ExtractBizModel();
            xypjjg.setModelName(XYPJJGModel.MODEL_NAME);
            xypjjg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            xypjjg.setExtractItemList(XYPJJGModel.createExtractItemList());
            bdm0.put(xypjjg.getModelName(), xypjjg);
        }

        {
            //M0-封皮-发行条款
            ExtractBizModel fxtk = new ExtractBizModel();
            fxtk.setModelName(FXTKModel.MODEL_NAME);
            fxtk.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxtk.setExtractItemList(FXTKModel.createExtractItemList());
            bdm0.put(fxtk.getModelName(), fxtk);
        }
        {
            //M0-封皮-主承销商
            ExtractBizModel zcxs = new ExtractBizModel();
            zcxs.setModelName(ZCXSModel.MODEL_NAME);
            zcxs.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            zcxs.setExtractItemList(ZCXSModel.createExtractItemList());
            bdm0.put(zcxs.getModelName(), zcxs);
        }
        {
            //M0-重要提示
            ExtractBizModel zyts = new ExtractBizModel();
            zyts.setModelName(ZYTSModel.MODEL_NAME);
            zyts.setExtractMethods(new ExtractMethod[]{ExtractMethod.TEXT});
            zyts.setExtractItemList(ZYTSModel.createExtractItemList());
            bdm0.put(zyts.getModelName(), zyts);
        }
        return bdm0;
    }

    /**
     * 名词释义
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM1ExtractBizModel() {
        bdm1=new HashMap<>();
        {
            //M1-名词释义
            ExtractBizModel mcsy = new ExtractBizModel();
            mcsy.setModelName(SYModel.MODEL_NAME);
            mcsy.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            mcsy.setExtractItemList(SYModel.createExtractItemList());
            bdm1.put(mcsy.getModelName(), mcsy);
        }

        return bdm1;
    }

    /**
     * 风险提示及说明
     * //TODO 需要定义模型
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM2ExtractBizModel() {
        bdm2=new HashMap<>();
        {
            //资产负债
            ExtractBizModel zcfz = new ExtractBizModel();
            zcfz.setModelName(ZCFZModel.MODEL_NAME);
            zcfz.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            zcfz.setExtractItemList(ZCFZModel.createExtractItemList());
            bdm2.put(zcfz.getModelName(), zcfz);
        }

        {
            //现金流量
            ExtractBizModel xjll = new ExtractBizModel();
            xjll.setModelName(XJLLModel.MODEL_NAME);
            xjll.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            xjll.setExtractItemList(XJLLModel.createExtractItemList());
            bdm2.put(xjll.getModelName(), xjll);
        }

        {
            //利润
            ExtractBizModel lr = new ExtractBizModel();
            lr.setModelName(LRModel.MODEL_NAME);
            lr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            lr.setExtractItemList(LRModel.createExtractItemList());
            bdm2.put(lr.getModelName(), lr);
        }
        return bdm2;
    }

    /**
     * 发行条款
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM3ExtractBizModel() {
        bdm3=new HashMap<>();
        {
            //M3发行条款
            ExtractBizModel fxtk = new ExtractBizModel();
            fxtk.setModelName(FXTKModel.MODEL_NAME);
            fxtk.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxtk.setExtractItemList(FXTKModel.createExtractItemList());
            bdm3.put(fxtk.getModelName(), fxtk);
        }
        return bdm3;
    }


    /**
     * 募集资金用途
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM4ExtractBizModel() {
        bdm4=new HashMap<>();
        {
            //募集资金用途
            ExtractBizModel mjzjyt = new ExtractBizModel();
            mjzjyt.setModelName(MJZJYTModel.MODEL_NAME);
            mjzjyt.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            mjzjyt.setExtractItemList(MJZJYTModel.createExtractItemList());
           bdm4.put(mjzjyt.getModelName(), mjzjyt);
        }

        {
            //有息债务
            ExtractBizModel yxzw = new ExtractBizModel();
            yxzw.setModelName(YXZWModel.MODEL_NAME);
            yxzw.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            yxzw.setExtractItemList(YXZWModel.createExtractItemList());
            bdm4.put(yxzw.getModelName(), yxzw);
        }
        return bdm4;
    }


    /**
     * 发行人基本状况
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM5ExtractBizModel() {
        bdm5=new HashMap<>();
        {
            //发行人基本信息
            ExtractBizModel fxr = new ExtractBizModel();
            fxr.setModelName(FXRModel.MODEL_NAME);
            fxr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxr.setExtractItemList(FXRModel.createExtractItemList());
            bdm5.put(fxr.getModelName(), fxr);
        }
        {
            //董监高
            ExtractBizModel djg = new ExtractBizModel();
            djg.setModelName(DJGModel.MODEL_NAME);
            djg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            djg.setExtractItemList(DJGModel.createExtractItemList());
            bdm5.put(djg.getModelName(), djg);
        }

        {
            //董事会
            ExtractBizModel dsh = new ExtractBizModel();
            dsh.setModelName(DSHModel.MODEL_NAME);
            dsh.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            dsh.setExtractItemList(DSHModel.createExtractItemList());
            bdm5.put(dsh.getModelName(), dsh);
        }

        {
            //监事会
            ExtractBizModel jsh = new ExtractBizModel();
            jsh.setModelName(JSHModel.MODEL_NAME);
            jsh.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            jsh.setExtractItemList(JSHModel.createExtractItemList());
           bdm5.put(jsh.getModelName(), jsh);
        }

        {
            //高管
            ExtractBizModel gg = new ExtractBizModel();
            gg.setModelName(GGModel.MODEL_NAME);
            gg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            gg.setExtractItemList(GGModel.createExtractItemList());
            bdm5.put(gg.getModelName(), gg);
        }

        {
            //营业收入
            ExtractBizModel yysr = new ExtractBizModel();
            yysr.setModelName(YYSRModel.MODEL_NAME);
            yysr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            yysr.setExtractItemList(YYSRModel.createExtractItemList());
            bdm5.put(yysr.getModelName(), yysr);
        }
        {
            //营业成本
            ExtractBizModel yycb = new ExtractBizModel();
            yycb.setModelName(YYCBModel.MODEL_NAME);
            yycb.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            yycb.setExtractItemList(YYCBModel.createExtractItemList());
            bdm5.put(yycb.getModelName(), yycb);
        }
        {
            //毛利润
            ExtractBizModel mlr = new ExtractBizModel();
            mlr.setModelName(MLRModel.MODEL_NAME);
            mlr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            mlr.setExtractItemList(MLRModel.createExtractItemList());
            bdm5.put(mlr.getModelName(), mlr);
        }
        {
            //毛利率
            ExtractBizModel mll = new ExtractBizModel();
            mll.setModelName(MLLModel.MODEL_NAME);
            mll.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            mll.setExtractItemList(MLLModel.createExtractItemList());
            bdm5.put(mll.getModelName(), mll);
        }

        {
            //在建工程
            ExtractBizModel zjgc = new ExtractBizModel();
            zjgc.setModelName(ZJGCModel.MODEL_NAME);
            zjgc.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            zjgc.setExtractItemList(ZJGCModel.createExtractItemList());
           bdm5.put(zjgc.getModelName(), zjgc);
        }
        {
            //已完工
            ExtractBizModel ywcgc = new ExtractBizModel();
            ywcgc.setModelName(YWGXMModel.MODEL_NAME);
            ywcgc.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            ywcgc.setExtractItemList(YWGXMModel.createExtractItemList());
            bdm5.put(ywcgc.getModelName(), ywcgc);
        }

        {
            //火电
            ExtractBizModel hd = new ExtractBizModel();
            hd.setModelName(HDModel.MODEL_NAME);
            hd.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            hd.setExtractItemList(HDModel.createExtractItemList());
            bdm5.put(HDModel.MODEL_NAME, hd);
        }
        {
            //高速公路
            ExtractBizModel gsgl = new ExtractBizModel();
            gsgl.setModelName(GSGLModel.MODEL_NAME);
            gsgl.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            gsgl.setExtractItemList(GSGLModel.createExtractItemList());
            bdm5.put(gsgl.getModelName(), gsgl);
        }

        {
            //水泥
            ExtractBizModel sn = new ExtractBizModel();
            sn.setModelName(SNModel.MODEL_NAME);
            sn.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            sn.setExtractItemList(SNModel.createExtractItemList());
            bdm5.put(sn.getModelName(), sn);
        }

        {
            //煤炭
            ExtractBizModel mt = new ExtractBizModel();
            mt.setModelName(MTModel.MODEL_NAME);
            mt.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            mt.setExtractItemList(MTModel.createExtractItemList());
           bdm5.put(mt.getModelName(), mt);
        }

        {
            //钢铁
            ExtractBizModel gt = new ExtractBizModel();
            gt.setModelName(GTModel.MODEL_NAME);
            gt.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            gt.setExtractItemList(GTModel.createExtractItemList());
           bdm5.put(gt.getModelName(), gt);
        }

        {
            //房地产
            ExtractBizModel fdc = new ExtractBizModel();
            fdc.setModelName(FDCModel.MODEL_NAME);
            fdc.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fdc.setExtractItemList(FDCModel.createExtractItemList());
            bdm5.put(fdc.getModelName(), fdc);
        }
        return bdm5;
    }


    /**
     * 财务状况
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM6ExtractBizModel() {
        bdm6=new HashMap<>();
        {
            //资产负债
            ExtractBizModel zcfz = new ExtractBizModel();
            zcfz.setModelName(ZCFZModel.MODEL_NAME);
            zcfz.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            zcfz.setExtractItemList(ZCFZModel.createExtractItemList());
            bdm6.put(zcfz.getModelName(), zcfz);
        }

        {
            //现金流量
            ExtractBizModel xjll = new ExtractBizModel();
            xjll.setModelName(XJLLModel.MODEL_NAME);
            xjll.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            xjll.setExtractItemList(XJLLModel.createExtractItemList());
            bdm6.put(xjll.getModelName(), xjll);
        }

        {
            //利润
            ExtractBizModel lr = new ExtractBizModel();
            lr.setModelName(LRModel.MODEL_NAME);
            lr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            lr.setExtractItemList(LRModel.createExtractItemList());
            bdm6.put(lr.getModelName(), lr);
        }

        {
            //偿债能力
            ExtractBizModel cznl = new ExtractBizModel();
            cznl.setModelName(CZNLModel.MODEL_NAME);
            cznl.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            cznl.setExtractItemList(CZNLModel.createExtractItemList());
            bdm6.put(cznl.getModelName(), cznl);
        }

        {
            //盈利能力
            ExtractBizModel ylnl = new ExtractBizModel();
            ylnl.setModelName(YLNLModel.MODEL_NAME);
            ylnl.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            ylnl.setExtractItemList(YLNLModel.createExtractItemList());
            bdm6.put(ylnl.getModelName(), ylnl);
        }

        {
            //运营能力
            ExtractBizModel yynl = new ExtractBizModel();
            yynl.setModelName(YYNLModel.MODEL_NAME);
            yynl.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            yynl.setExtractItemList(YYNLModel.createExtractItemList());
            bdm6.put(yynl.getModelName(), yynl);
        }

        {
            //对外担保金额
            ExtractBizModel dwdb = new ExtractBizModel();
            dwdb.setModelName(DWDBModel.MODEL_NAME);
            dwdb.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            dwdb.setExtractItemList(DWDBModel.createExtractItemList());
            bdm6.put(dwdb.getModelName(), dwdb);
        }

        {
            //受限资产
            ExtractBizModel sxzc = new ExtractBizModel();
            sxzc.setModelName(SXZCModel.MODEL_NAME);
            sxzc.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            sxzc.setExtractItemList(SXZCModel.createExtractItemList());
            bdm6.put(sxzc.getModelName(), sxzc);
        }
        return bdm6;
    }


    /**
     * 企业资信状况
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM7ExtractBizModel() {
        bdm7=new HashMap<>();
        {
            //
            ExtractBizModel xypjjg = new ExtractBizModel();
            xypjjg.setModelName(XYPJJGModel.MODEL_NAME);
            xypjjg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            xypjjg.setExtractItemList(XYPJJGModel.createExtractItemList());
            bdm7.put(xypjjg.getModelName(), xypjjg);
        }

        {
            //
            ExtractBizModel sx = new ExtractBizModel();
            sx.setModelName(SXModel.MODEL_NAME);
            sx.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            sx.setExtractItemList(SXModel.createExtractItemList());
            bdm7.put(sx.getModelName(), sx);
        }
        return bdm7;
    }


    /**
     * 债务融资工具信用增进
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM8ExtractBizModel() {
        bdm8=new HashMap<>();
        {

        }

        return bdm8;
    }


    /**
     * 税项
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM9ExtractBizModel() {
        bdm9=new HashMap<>();
        {

        }

        return bdm9;
    }


    /**
     * 定期信息披露
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM10ExtractBizModel() {
        bdm10=new HashMap<>();
        {

        }

        return bdm10;
    }


    /**
     * 投资人保护条款
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM11ExtractBizModel() {
        bdm11=new HashMap<>();
        {

        }

        return bdm11;
    }

    /**
     * 发行有关机构
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM12ExtractBizModel() {
        bdm12=new HashMap<>();
        {
            //发行机构
            ExtractBizModel fxjg = new ExtractBizModel();
            fxjg.setModelName(FXJGModel.MODEL_NAME);
            fxjg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxjg.setExtractItemList(FXJGModel.createExtractItemList());
            bdm12.put(fxjg.getModelName(), fxjg);
        }
        {
            //发行人
            ExtractBizModel fxr = new ExtractBizModel();
            fxr.setModelName(FXRModel.MODEL_NAME);
            fxr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxr.setExtractItemList(FXRModel.createExtractItemList());
            bdm12.put(fxr.getModelName(), fxr);
        }

        {
            //律师事务所
            ExtractBizModel lssws = new ExtractBizModel();
            lssws.setModelName(LSSWSModel.MODEL_NAME);
            lssws.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            lssws.setExtractItemList(LSSWSModel.createExtractItemList());
            bdm12.put(lssws.getModelName(), lssws);
        }

        {
            //主承销商
            ExtractBizModel zcxs = new ExtractBizModel();
            zcxs.setModelName(ZCXSModel.MODEL_NAME);
            zcxs.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            zcxs.setExtractItemList(ZCXSModel.createExtractItemList());
            bdm12.put(zcxs.getModelName(), zcxs);
        }

        {
            //审计事务所
            ExtractBizModel sjsws = new ExtractBizModel();
            sjsws.setModelName(SJSWSModel.MODEL_NAME);
            sjsws.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            sjsws.setExtractItemList(SJSWSModel.createExtractItemList());
            bdm12.put(sjsws.getModelName(), sjsws);
        }

        return bdm12;
    }

    /**
     * 备查文件
     *
     * @return
     */
    private Map<String, ExtractBizModel> createBDM13ExtractBizModel() {
        bdm13=new HashMap<>();
        {
            //M13-信用评级机构
            ExtractBizModel xypjjg = new ExtractBizModel();
            xypjjg.setModelName(XYPJJGModel.MODEL_NAME);
            xypjjg.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            xypjjg.setExtractItemList(XYPJJGModel.createExtractItemList());
            bdm13.put(xypjjg.getModelName(), xypjjg);
        }

        {
            //M13-发行人
            ExtractBizModel fxr = new ExtractBizModel();
            fxr.setModelName(FXRModel.MODEL_NAME);
            fxr.setExtractMethods(new ExtractMethod[]{ExtractMethod.KV, ExtractMethod.TABLE});
            fxr.setExtractItemList(FXRModel.createExtractItemList());
            bdm13.put(fxr.getModelName(), fxr);
        }
        return bdm13;
    }

    private static Map<String, Class<? extends MTableExtractor>> extractorMap = new LinkedHashMap<String, Class<? extends MTableExtractor>>();
    static Map<String, String> items = new LinkedHashMap<>();
    static Map<String, List<String>> subTableItemMap = new HashMap<>();

    static Map<String, String> subItems = new HashMap<>();
    static Map<String, String> subItemSynonyms = new HashMap<>();

    static {
        items.put(BDMTable.BDM0, "目录");
        items.put(BDMTable.BDM1, "释义");
        items.put(BDMTable.BDM2, "风险提示及说明|风险提示");
        items.put(BDMTable.BDM3, "发行条款|发行安排");
        items.put(BDMTable.BDM4, "募集资金运用|募集资金用途|募集资金主要用途");
        items.put(BDMTable.BDM5, "企业基本情况|发行人基本情况|公司基本情况|基本情况");
        items.put(BDMTable.BDM6, "企业主要财务状况|主要财务状况|财务情况|财务状况");
        items.put(BDMTable.BDM7, "企业资信状况|发行人资信状况|发行人资信状况|资信情况|资信状况");
        items.put(BDMTable.BDM8, "债务融资工具信用增进|信用增进情况|担保|担保状况|信用增进");
        items.put(BDMTable.BDM9, "定向信息披露安排|信息披露安排|定期信息披露|信息披露工作安排|信息披露");
        items.put(BDMTable.BDM10, "投资者保护机制|违约责任和投资者保护机制|投资人保护机制");
        items.put(BDMTable.BDM11, "定向投资人名单|定向投资人名称");
        items.put(BDMTable.BDM12, "发行有关机构|有关机构|发行有关的机构");
        items.put(BDMTable.BDM13, "备查文件");

        extractorMap.put(BDMTable.BDM0, M0Extractor.class);
        extractorMap.put(BDMTable.BDM1, M1Extractor.class);
        extractorMap.put(BDMTable.BDM2, M2Extractor.class);
        extractorMap.put(BDMTable.BDM3, M3Extractor.class);
        extractorMap.put(BDMTable.BDM4, M4Extractor.class);
        extractorMap.put(BDMTable.BDM5, M5Extractor.class);
        extractorMap.put(BDMTable.BDM6, M6Extractor.class);
        extractorMap.put(BDMTable.BDM7, M7Extractor.class);
        extractorMap.put(BDMTable.BDM8, M8Extractor.class);
        extractorMap.put(BDMTable.BDM9, M9Extractor.class);
        extractorMap.put(BDMTable.BDM10, M10Extractor.class);
        extractorMap.put(BDMTable.BDM11, M11Extractor.class);
        extractorMap.put(BDMTable.BDM12, M12Extractor.class);
        extractorMap.put(BDMTable.BDM13, M13Extractor.class);
    }


    @Override
    public Map<String, Class<? extends MTableExtractor>> createMTableExtractors() {
        return extractorMap;
    }

    @Override
    public void initTable() {
        List<TableItem> tableItemList = new ArrayList<>();
        TableItem tableItem = null;
        for (Iterator<String> it = items.keySet().iterator(); it.hasNext(); ) {
            String key = it.next();
            tableItem = new TableItem();
            String[] synonyms = items.get(key).split("\\|");
            tableItem.setItemName(synonyms[0]);
            tableItem.setItemNo(key);
            tableItem.setSynonyms(Arrays.asList(synonyms));
            tableItem.setPrefixList(FXRModel.getSynonyms("FXRMC"));
            tableItemList.add(tableItem);
            if (subItems.containsKey(key)) {
                List<String> subItems = subTableItemMap.get(key);
                for (int i = 0; i < subItems.size(); i++) {
                    String subItemNo = subItems.get(i);
                    TableItem subTableItem = new TableItem();
                    subTableItem.setItemNo(subItemNo);
                    subTableItem.setItemName(subItemSynonyms.get(subItemNo));
                }
            }
        }
        setTableItemList(tableItemList);
    }


    public List<String> getSynonyms() {
        List<String> synonyms = new ArrayList<>();
        for (Iterator<String> it = items.keySet().iterator(); it.hasNext(); ) {
            String key = it.next();
            String value = items.get(key);
            synonyms.addAll(Arrays.asList(value.split(SYNONYM_SPLIT_CHAR)));
        }
        return synonyms;
    }

    @Override
    public List<String> getFilters() {
        return null;
    }

    public static String SYNONYM_SPLIT_CHAR = "\\|";

}
